<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>clk_wiz: xclk_wiz_intr_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">clk_wiz
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xclk__wiz__intr__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xclk_wiz_intr_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example using the <a class="el" href="struct_x_clk___wiz.html" title="The XClk_Wiz driver instance data. ">XClk_Wiz</a> driver with interrupts it will generate interrupt for clok glitch, clock overflow and underflow The user should have setup with 2 clocking wizard instances, one instance act as clocking monitor (Enable clock monitor in GUI), In another instance enable dynamic clock reconfiguration. </p>
<p>In the present example XCLK_WIZ_DYN_DEVICE_ID assigned to clock wizard 1. Modify this value as per your dynamic clock reconfiguration Clocking wizard</p>
<dl class="section note"><dt>Note</dt><dd>This example requires an interrupt controller connected to the processor and the MIPI CLK_WIZ in the system. <pre>
MODIFICATION HISTORY:</pre></dd></dl>
<p>Ver Who Date Changes </p><hr/>
<p> 1.0 ram 2/12/16 Initial version for Clock Wizard 1.1 ms 01/23/17 Modified xil_printf statement in main function to ensure that "Successfully ran" and "Failed" strings are available in all examples. This is a fix for CR-965028.  </p>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a1fb9a1ea241c6aaff3831259bcc6448f"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xclk__wiz__intr__example_8c.html#a1fb9a1ea241c6aaff3831259bcc6448f">ClkWiz_IntrExample</a> (INTC *IntcInstancePtr, u32 DeviceId)</td></tr>
<tr class="memdesc:a1fb9a1ea241c6aaff3831259bcc6448f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the main entry point for the interrupt example using the <a class="el" href="struct_x_clk___wiz.html" title="The XClk_Wiz driver instance data. ">XClk_Wiz</a> driver.  <a href="#a1fb9a1ea241c6aaff3831259bcc6448f">More...</a><br /></td></tr>
<tr class="separator:a1fb9a1ea241c6aaff3831259bcc6448f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa33a11c5d5f2eae8e4ab36e0bdb6e38d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xclk__wiz__intr__example_8c.html#aa33a11c5d5f2eae8e4ab36e0bdb6e38d">SetupInterruptSystem</a> (INTC *IntcInstancePtr, <a class="el" href="struct_x_clk___wiz.html">XClk_Wiz</a> *ClkWizPtr)</td></tr>
<tr class="memdesc:aa33a11c5d5f2eae8e4ab36e0bdb6e38d"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function setups the interrupt system such that interrupts can occur for the CLK_WIZ device.  <a href="#aa33a11c5d5f2eae8e4ab36e0bdb6e38d">More...</a><br /></td></tr>
<tr class="separator:aa33a11c5d5f2eae8e4ab36e0bdb6e38d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab4d4ca4b2b5d036b0e0df621692135f6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__clk__wiz__v1__0.html#gab4d4ca4b2b5d036b0e0df621692135f6">XClk_Wiz_IntrHandler</a> (void *InstancePtr)</td></tr>
<tr class="memdesc:gab4d4ca4b2b5d036b0e0df621692135f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the interrupt handler for the CLK_WIZ core.  <a href="group__clk__wiz__v1__0.html#gab4d4ca4b2b5d036b0e0df621692135f6">More...</a><br /></td></tr>
<tr class="separator:gab4d4ca4b2b5d036b0e0df621692135f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4f547fb0dce8abc367979e38081a5080"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__clk__wiz__v1__0.html#ga4f547fb0dce8abc367979e38081a5080">XClk_Wiz_InterruptEnable</a> (<a class="el" href="struct_x_clk___wiz.html">XClk_Wiz</a> *InstancePtr, u32 Mask)</td></tr>
<tr class="memdesc:ga4f547fb0dce8abc367979e38081a5080"><td class="mdescLeft">&#160;</td><td class="mdescRight">XClk_Wiz_InterruptEnable will enable the interrupts present in the interrupt mask passed onto the function.  <a href="group__clk__wiz__v1__0.html#ga4f547fb0dce8abc367979e38081a5080">More...</a><br /></td></tr>
<tr class="separator:ga4f547fb0dce8abc367979e38081a5080"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf3c110063d937f1fbe69c0e299fe55d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xclk__wiz__intr__example_8c.html#aaf3c110063d937f1fbe69c0e299fe55d">Clk_Wiz_Reconfig</a> (<a class="el" href="struct_x_clk___wiz___config.html">XClk_Wiz_Config</a> *CfgPtr_Dynamic)</td></tr>
<tr class="memdesc:aaf3c110063d937f1fbe69c0e299fe55d"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the Clk_Wiz_Reconfig function, it will reconfigure frequencies as per input array.  <a href="#aaf3c110063d937f1fbe69c0e299fe55d">More...</a><br /></td></tr>
<tr class="separator:aaf3c110063d937f1fbe69c0e299fe55d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6b07f0022d7f609127ba69fcce3a6ca"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xclk__wiz__intr__example_8c.html#ab6b07f0022d7f609127ba69fcce3a6ca">Wait_For_Lock</a> (<a class="el" href="struct_x_clk___wiz___config.html">XClk_Wiz_Config</a> *CfgPtr_Dynamic)</td></tr>
<tr class="memdesc:ab6b07f0022d7f609127ba69fcce3a6ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the Wait_For_Lock function, it will wait for lock to settle change frequency value.  <a href="#ab6b07f0022d7f609127ba69fcce3a6ca">More...</a><br /></td></tr>
<tr class="separator:ab6b07f0022d7f609127ba69fcce3a6ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf464e4d1be9b2b093b568d721920bb2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xclk__wiz__intr__example_8c.html#abf464e4d1be9b2b093b568d721920bb2">ClkWiz_ClkOutOfRangeEventHandler</a> (void *CallBackRef, u32 Mask)</td></tr>
<tr class="memdesc:abf464e4d1be9b2b093b568d721920bb2"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called when a clock out of range is received by the CLK_WIZ Subsystem core.  <a href="#abf464e4d1be9b2b093b568d721920bb2">More...</a><br /></td></tr>
<tr class="separator:abf464e4d1be9b2b093b568d721920bb2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a129f20100bd1ab7e3165219f38659e90"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xclk__wiz__intr__example_8c.html#a129f20100bd1ab7e3165219f38659e90">ClkWiz_ClkGlitchEventHandler</a> (void *CallBackRef, u32 Mask)</td></tr>
<tr class="memdesc:a129f20100bd1ab7e3165219f38659e90"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called when a clock glitch event is received by the CLK_WIZ Subsystem core.  <a href="#a129f20100bd1ab7e3165219f38659e90">More...</a><br /></td></tr>
<tr class="separator:a129f20100bd1ab7e3165219f38659e90"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24a8c4f20358d67ba7512698e94ec60d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xclk__wiz__intr__example_8c.html#a24a8c4f20358d67ba7512698e94ec60d">ClkWiz_ClkStopEventHandler</a> (void *CallBackRef, u32 Mask)</td></tr>
<tr class="memdesc:a24a8c4f20358d67ba7512698e94ec60d"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called when a clock stop event is received by the CLK_WIZ Subsystem core.  <a href="#a24a8c4f20358d67ba7512698e94ec60d">More...</a><br /></td></tr>
<tr class="separator:a24a8c4f20358d67ba7512698e94ec60d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa93f4f357d4911b56121f95a2917cd1a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xclk__wiz__intr__example_8c.html#aa93f4f357d4911b56121f95a2917cd1a">Delay</a> (u32 Seconds)</td></tr>
<tr class="memdesc:aa93f4f357d4911b56121f95a2917cd1a"><td class="mdescLeft">&#160;</td><td class="mdescRight">For Microblaze we use an assembly loop that is roughly the same regardless of optimization level, although caches and memory access time can make the delay vary.  <a href="#aa93f4f357d4911b56121f95a2917cd1a">More...</a><br /></td></tr>
<tr class="separator:aa93f4f357d4911b56121f95a2917cd1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xclk__wiz__intr__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the main function for <a class="el" href="struct_x_clk___wiz.html" title="The XClk_Wiz driver instance data. ">XClk_Wiz</a> interrupt example.  <a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">More...</a><br /></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="aaf3c110063d937f1fbe69c0e299fe55d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf3c110063d937f1fbe69c0e299fe55d">&#9670;&nbsp;</a></span>Clk_Wiz_Reconfig()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Clk_Wiz_Reconfig </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_clk___wiz___config.html">XClk_Wiz_Config</a> *&#160;</td>
          <td class="paramname"><em>CfgPtr_Dynamic</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the Clk_Wiz_Reconfig function, it will reconfigure frequencies as per input array. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CfgPtr_Dynamic</td><td>provides pointer to clock wizard dynamic config </td></tr>
    <tr><td class="paramname">Findex</td><td>provides the index for Frequency divide register </td></tr>
    <tr><td class="paramname">Sindex</td><td>provides the index for Frequency phase register</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>Error 0 for pass scenario</li>
<li>Error &gt; 0 for failure scenario</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p class="reference">References <a class="el" href="struct_x_clk___wiz___config.html#aa737385b3fd370d1bb677f0b366cdbd0">XClk_Wiz_Config::BaseAddr</a>, and <a class="el" href="xclk__wiz__intr__example_8c.html#ab6b07f0022d7f609127ba69fcce3a6ca">Wait_For_Lock()</a>.</p>

</div>
</div>
<a id="a129f20100bd1ab7e3165219f38659e90"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a129f20100bd1ab7e3165219f38659e90">&#9670;&nbsp;</a></span>ClkWiz_ClkGlitchEventHandler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ClkWiz_ClkGlitchEventHandler </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>CallBackRef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is called when a clock glitch event is received by the CLK_WIZ Subsystem core. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CallBackRef</td><td>contains a callback reference from the driver. In this case it is the instance pointer for the ClkWiz_Mon driver.</td></tr>
    <tr><td class="paramname">Mask</td><td>of interrupt which caused this event</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p class="reference">References <a class="el" href="group__clk__wiz__v1__0.html#gabf7f48abd562e1b1389b86bb978f091e">XCLK_WIZ_ISR_CLK0_GLITCH_MASK</a>, <a class="el" href="group__clk__wiz__v1__0.html#gafcb540ab2c83a559450ae71633258269">XCLK_WIZ_ISR_CLK1_GLITCH_MASK</a>, <a class="el" href="group__clk__wiz__v1__0.html#gaa79abe7629e383c5d83f09ab640a7267">XCLK_WIZ_ISR_CLK2_GLITCH_MASK</a>, and <a class="el" href="group__clk__wiz__v1__0.html#ga5634a366b8ced209061e028c163fddd5">XCLK_WIZ_ISR_CLK3_GLITCH_MASK</a>.</p>

</div>
</div>
<a id="abf464e4d1be9b2b093b568d721920bb2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf464e4d1be9b2b093b568d721920bb2">&#9670;&nbsp;</a></span>ClkWiz_ClkOutOfRangeEventHandler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ClkWiz_ClkOutOfRangeEventHandler </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>CallBackRef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is called when a clock out of range is received by the CLK_WIZ Subsystem core. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CallBackRef</td><td>contains a callback reference from the driver. In this case it is the instance pointer for the ClkWiz_Mon driver.</td></tr>
    <tr><td class="paramname">Mask</td><td>of interrupt which caused this event</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p class="reference">References <a class="el" href="group__clk__wiz__v1__0.html#ga5e762fe87dddbe8ac453306748a216f5">XCLK_WIZ_ISR_CLK0_MAXFREQ_MASK</a>, <a class="el" href="group__clk__wiz__v1__0.html#ga37ecc718da5a33c16329f6f6d1967e4e">XCLK_WIZ_ISR_CLK0_MINFREQ_MASK</a>, <a class="el" href="group__clk__wiz__v1__0.html#ga834ed8f9541edc0c5be94ca0de404f87">XCLK_WIZ_ISR_CLK1_MAXFREQ_MASK</a>, <a class="el" href="group__clk__wiz__v1__0.html#ga8e3dd7df0cf46c203cab6d190c9e4cd9">XCLK_WIZ_ISR_CLK1_MINFREQ_MASK</a>, <a class="el" href="group__clk__wiz__v1__0.html#ga2cfaf083bfc11e4d527262c6dfe0c24e">XCLK_WIZ_ISR_CLK2_MAXFREQ_MASK</a>, <a class="el" href="group__clk__wiz__v1__0.html#ga24b899afdcc87e9a2c97eabe52fb610c">XCLK_WIZ_ISR_CLK2_MINFREQ_MASK</a>, <a class="el" href="group__clk__wiz__v1__0.html#ga9a3354cec0d629d0ed3c26d28bbd1994">XCLK_WIZ_ISR_CLK3_MAXFREQ_MASK</a>, and <a class="el" href="group__clk__wiz__v1__0.html#ga163b2686ce7e37b98fc9d510a95febdb">XCLK_WIZ_ISR_CLK3_MINFREQ_MASK</a>.</p>

</div>
</div>
<a id="a24a8c4f20358d67ba7512698e94ec60d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a24a8c4f20358d67ba7512698e94ec60d">&#9670;&nbsp;</a></span>ClkWiz_ClkStopEventHandler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ClkWiz_ClkStopEventHandler </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>CallBackRef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is called when a clock stop event is received by the CLK_WIZ Subsystem core. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CallBackRef</td><td>is a pointer to the <a class="el" href="struct_x_clk___wiz.html" title="The XClk_Wiz driver instance data. ">XClk_Wiz</a> instance.</td></tr>
    <tr><td class="paramname">Mask</td><td>of interrupt which caused this event</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p class="reference">References <a class="el" href="group__clk__wiz__v1__0.html#ga29f231a7715e94baec2277b768f5f1a5">XCLK_WIZ_ISR_CLK0_STOP_MASK</a>, <a class="el" href="group__clk__wiz__v1__0.html#ga7152a10657a3caeef169c0be28087362">XCLK_WIZ_ISR_CLK1_STOP_MASK</a>, <a class="el" href="group__clk__wiz__v1__0.html#gab7ecb70f6cf41fd44769722fdcf2a6a6">XCLK_WIZ_ISR_CLK2_STOP_MASK</a>, and <a class="el" href="group__clk__wiz__v1__0.html#ga6a11cf2b70a1598342cde6ad50577ec9">XCLK_WIZ_ISR_CLK3_STOP_MASK</a>.</p>

</div>
</div>
<a id="a1fb9a1ea241c6aaff3831259bcc6448f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1fb9a1ea241c6aaff3831259bcc6448f">&#9670;&nbsp;</a></span>ClkWiz_IntrExample()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 ClkWiz_IntrExample </td>
          <td>(</td>
          <td class="paramtype">INTC *&#160;</td>
          <td class="paramname"><em>IntcInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>DeviceId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the main entry point for the interrupt example using the <a class="el" href="struct_x_clk___wiz.html" title="The XClk_Wiz driver instance data. ">XClk_Wiz</a> driver. </p>
<p>This function will set up the system with interrupts handlers.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DeviceId</td><td>is the unique device ID of the CLK_WIZ Subsystem core.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_FAILURE if the system setup failed.</li>
<li>XST_SUCCESS should never return since this function, if setup was successful, is blocking.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>If system setup was successful, this function is blocking in order to illustrate interrupt handling taking place for HPD events. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xclk__wiz__intr__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>.</p>

</div>
</div>
<a id="aa93f4f357d4911b56121f95a2917cd1a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa93f4f357d4911b56121f95a2917cd1a">&#9670;&nbsp;</a></span>Delay()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Delay </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Seconds</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>For Microblaze we use an assembly loop that is roughly the same regardless of optimization level, although caches and memory access time can make the delay vary. </p>
<p>Just keep in mind that after resetting or updating the PHY modes, the PHY typically needs time to recover.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Number</td><td>of seconds to sleep</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

</div>
</div>
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">&#9670;&nbsp;</a></span>main()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the main function for <a class="el" href="struct_x_clk___wiz.html" title="The XClk_Wiz driver instance data. ">XClk_Wiz</a> interrupt example. </p>
<p>If the ClkWiz_IntrExample function which sets up the system succeeds, this function will wait for the interrupts. Notify the events</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_FAILURE if the interrupt example was unsuccessful.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Unless setup failed, main will never return since ClkWiz_IntrExample is blocking (it is waiting on interrupts for Hot-Plug-Detect (HPD) events. </dd></dl>

<p class="reference">References <a class="el" href="xclk__wiz__intr__example_8c.html#a1fb9a1ea241c6aaff3831259bcc6448f">ClkWiz_IntrExample()</a>.</p>

</div>
</div>
<a id="aa33a11c5d5f2eae8e4ab36e0bdb6e38d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa33a11c5d5f2eae8e4ab36e0bdb6e38d">&#9670;&nbsp;</a></span>SetupInterruptSystem()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int SetupInterruptSystem </td>
          <td>(</td>
          <td class="paramtype">INTC *&#160;</td>
          <td class="paramname"><em>IntcInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_clk___wiz.html">XClk_Wiz</a> *&#160;</td>
          <td class="paramname"><em>ClkWizPtr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function setups the interrupt system such that interrupts can occur for the CLK_WIZ device. </p>
<p>This function is application specific since the actual system may or may not have an interrupt controller. The CLK_WIZ could be directly connected to a processor without an interrupt controller. The user should modify this function to fit the application.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ClkWizPtr</td><td>contains a pointer to the instance of the CLK_WIZ component which is going to be connected to the interrupt controller.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, otherwise XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

</div>
</div>
<a id="ab6b07f0022d7f609127ba69fcce3a6ca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab6b07f0022d7f609127ba69fcce3a6ca">&#9670;&nbsp;</a></span>Wait_For_Lock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Wait_For_Lock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_clk___wiz___config.html">XClk_Wiz_Config</a> *&#160;</td>
          <td class="paramname"><em>CfgPtr_Dynamic</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the Wait_For_Lock function, it will wait for lock to settle change frequency value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CfgPtr_Dynamic</td><td>provides pointer to clock wizard dynamic config</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>Error 0 for pass scenario</li>
<li>Error &gt; 0 for failure scenario</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p class="reference">References <a class="el" href="struct_x_clk___wiz___config.html#aa737385b3fd370d1bb677f0b366cdbd0">XClk_Wiz_Config::BaseAddr</a>.</p>

<p class="reference">Referenced by <a class="el" href="xclk__wiz__intr__example_8c.html#aaf3c110063d937f1fbe69c0e299fe55d">Clk_Wiz_Reconfig()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
